package command.menu.project;

import javax.xml.bind.annotation.XmlTransient;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import model.User;
import controller.ApplicationController;

public class CreateUserOutOfProjectCommand extends AbstractProjectCommand {

	@XmlTransient
	private static final Logger log = LoggerFactory
			.getLogger(CreateUserOutOfProjectCommand.class);
	
	private String userName;

	public CreateUserOutOfProjectCommand(String userName) {
		this.userName = userName;
	}

	@Override
	public void executeLocal(ApplicationController applicationController) {
		log.debug("Executing command : CreateUserOutOfProjectCommand ...");
		User user = applicationController.getUserFactory().createUser(userName);
		applicationController.setCreatedOutOfProjectUser(user);
		log.debug("Executing command : CreateUserOutOfProjectCommand DONE");
	}

	@Override
	public void executeRemote(ApplicationController applicationController) {		
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
}
